package cn.fzkj.framework.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/** 文件上传静态资源映射 */
@Configuration
public class UploadConfig
        implements WebMvcConfigurer {
    @Value("${file.static-accessPath}")
    private String staticAccessPath;
    @Value("${img.path}")
    private String uploadFolder;
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler(staticAccessPath).addResourceLocations("file:" + uploadFolder);
    }

}
